// var OSS = require('ali-oss')
import OSS from 'ali-oss'
export function client() {
  return new OSS({
    region: 'oss-cn-hangzhou',
    accessKeyId: 'LTAIGIa87g6gX5xZ',
    accessKeySecret: 'RDBjYFlZAG31KSA6T2oQK12KR3omtD',
    bucket: 'toursdata',
    secure: true
  })
}
export function randomWord(randomFlag, number) {
  var str = "",
    range = number,
    pos = '',
    arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
  if (randomFlag) {
    range = Math.round(Math.random()) + number
  }
  for (var i = 0; i < range; i++) {
    pos = Math.round(Math.random() * (arr.length - 1))
    str += arr[pos]
  }
  return str
}